<template>
	<KycItem
		titleT="settings.kyc.Basic"
		:type="SettingsShowEnum.baseInfo"
		:status="!!profileStore.userInfo?.baseInfoVerifyStatus"
		icon="protocol">
		<div v-if="profileStore.userInfo?.identityVerifyStatus === 5" class="py-[14px]">
			{{ $t('settings.kyc.verifiedSuccess') }}
		</div>
		<BaseButton
			v-else
			class="h-10"
			:class="submitted ? 'default' : ''"
			:block="false"
			:type="submitted ? 'default' : 'primary'"
			:disabled="disabled"
			:textT="submitted ? 'settings.kyc.ViewAndUpdate' : 'settings.kyc.Submit'"
			@click="profileStore.show.baseInfo = true" />
	</KycItem>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { BaseButton } from '@/components/base'
import { useProfileStore } from '@/store'
import { SettingsShowEnum } from '@/types'
import { KycItem } from '../components'

const profileStore = useProfileStore()
const disabled = computed(
	() => !(profileStore.userInfo?.emailVerify || profileStore.userInfo?.mobileVerify)
)
const submitted = computed(() => !!profileStore.userInfo?.baseInfoVerifyStatus)
</script>
